package com.gzsxy.esjy.sign.dto;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * 签字板消息
 * @author zhangxiaolong
 * @since 2022/7/15
 */
@Getter
@Setter
@NoArgsConstructor
public class ScreenSignDevMsgDto {
    /**
     * pdf下载链接
     */
    private String downUrl;

    /**
     * 签名和指纹位置
     */
    private String location = "0,1,400,80|1,1,430,80";

    /**
     * 请求超时
     */
    private int timeout = 600;

    /**
     * 已签名的pdf base64
     */
    private String signedPdf;

    /**
     * 是否重新签名，1为重新签名，0为非重签，默认非重签
     */
    private int isReSign;

    /**
     * 签字板返回信息接口url（回调接口）
     */
    private String postUrl;

    /**
     * 要取消的任务requestId
     */
    private String devRequestID;

    /**
     * 提示信息
     */
    private String prompMsg = "";

    /**
     * 提示信息是否开启
     * 0-关闭 1-开启
     */
    private int pmMode = 0;

    /**
     * 签名模式:0-指定位置签名,1-任意位置签名，2-仅签名模式
     */
    private int signMode = 0;

    /**
     * 是否录像，0-否，1-是
     */
    private int signRecord = 0;

    public ScreenSignDevMsgDto(String devRequestID) {
        this.devRequestID = devRequestID;
    }

    public ScreenSignDevMsgDto(String pdfHttpPath, String httpSignOkUrl, Integer signRecord, String devRequestId) {
        this.downUrl = pdfHttpPath;
        this.postUrl = httpSignOkUrl;
        this.isReSign = 0;
        this.timeout = 5 * 60;
        this.signRecord = signRecord;
        this.signMode = 1;
        this.devRequestID = devRequestId;
    }

    public void setLocationByPages(int pages) {
        this.location = "0," + pages + ",400,80|1," + pages + ",430,80";
    }

}